package com.flame.file.exception;

import java.text.MessageFormat;

import com.flame.core.exception.ExceptionLevel;
import com.flame.core.exception.ExceptionMessage;

/**
 * flame_sys_file_info 系统文件表
 *
 * @author 吴欣童
 * @since 2022-11-28 13:50:59
 */
public enum FileInfoExceptionMessage implements ExceptionMessage {
    FILEINFO_EXIST("100001", "添加失败，md5[{0}]相同文件已存在", ExceptionLevel.INFO),
    UPLOAD_ERROR_FILE_EXIST("100001", "上传失败，相同文件名文件已存在", ExceptionLevel.INFO),
    FILEINFO_NOT_EXIST("100001", "下载失败，文件不存在", ExceptionLevel.INFO);

    private String code;

    private String message;

    private ExceptionLevel level;

    FileInfoExceptionMessage(String code, String message, ExceptionLevel level) {
        this.code = code;
        this.message = message;
        this.level = level;
    }

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    @Override
    public String getMessage(Object... args) {
        return MessageFormat.format(this.message, args);
    }

    @Override
    public ExceptionLevel getLevel() {
        return level;
    }
}
